import useLocalStorage from "@/utils/useLocalStorage";
import { ref, watchEffect } from "vue";
const { getItem, setItem } = useLocalStorage();
const useStorage = () => {
  const KEY = "TODOS";
  const todos = ref(getItem(KEY) || []);
  watchEffect(() => {
    setItem(KEY, todos.value);
  });
  return todos;
};

export default useStorage;
